home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / lang / HeliOS3.lha / helios_demo_disk3 / source / Fonts_Demo.src < prev    next >
Encoding:
Text File  |  1996-02-26  |  18.6 KB  |  723 lines

  1.  
  2.   \ ***********************************************************
  3.   \
  4.   \                         FONTS DEMO
  5.   \
  6.   \ ***********************************************************
  7.   \
  8.   \ This code demonstrates how to display text in various fonts
  9.   \ using both standard Amiga fonts and HeliOS colour bitmap fonts.
  10.   \
  11.   \ The demo shows how both these types of font may be used in
  12.   \ HeliOS "Game Mode" or under the Amiga operating system.
  13.   \
  14.   \ First the production of text using both types of fonts is
  15.   \ demonstrated under the Amiga operating system.
  16.   \
  17.   \ An IFF file is then loaded and displayed under the HeliOS
  18.   \ Game operating system, after which text using the various
  19.   \ fonts is displayed once more.
  20.   \
  21.   \ ***********************************************************
  22.  
  23.  
  24.   \ ***********************************************************
  25.   \ Re-initialise HeliOS dictionary to standard CORE vocabulary
  26.   \ ***********************************************************
  27.  
  28.   \ This should always be used at the start of any program which
  29.   \ is to be repeatedly recompiled.
  30.  
  31.   FORGET **CORE**
  32.  
  33.   \ *************************
  34.   \ Load include symbol files
  35.   \ *************************
  36.   \
  37.   \ These "include files" are pre-compiled (for speed) versions of the
  38.   \ Amiga includes and the Helios system includes.
  39.   \
  40.   \ Uncomment the lines below for standalone compilation, but otherwise
  41.   \ it is better to set these include files from the Helios Forth menus
  42.  
  43.   AMIGAINCLUDE HeliOS:HeliOS_AmigaInclude
  44.   USERINCLUDE  HeliOS:HeliOS_UserInclude
  45.  
  46.   \ ***************************************
  47.   \ Create display imagery file name string
  48.   \ ***************************************
  49.  
  50.   \ This file is an ordinary IFF (and may be "PowerPacked" if required)
  51.   \
  52.   \ The picture here will be loaded into the display BitMap.
  53.   \
  54.  
  55.   $CONSTANTL Slice1Pic $HeliOS:Source/Data/Pic2$
  56.  
  57.   \ ****************************************************
  58.   \ Create colour font and texture map file name strings
  59.   \ ****************************************************
  60.  
  61.   \ These files are ordinary IFFs (and may be "PowerPacked" if required)
  62.   \
  63.  
  64.   $CONSTANTL ColourFontPic $HeliOS:Source/Data/ColourFont16*16$
  65.   $CONSTANTL TextureMapPic $HeliOS:Source/Data/FontTextureMap$
  66.  
  67.   \ **************************************
  68.   \ Create display configuration constants
  69.   \ **************************************
  70.   \
  71.   \ Collect all "display-specific" parameters here and generate "named"
  72.   \ constants which make references easier than using numeric values.
  73.   \
  74.   \ Collecting these together here makes it easier to adjust things at any
  75.   \ time without having to search source code to replace values individually.
  76.   \
  77.  
  78.  
  79.   256                      CONSTANT DisplayHeight      \ Full PAL display
  80.   320                      CONSTANT DisplayWidth       \ Lores display
  81.   44                       CONSTANT DisplayTopLine     \ Display start
  82.  
  83.   DisplayWidth             CONSTANT Slice1Width        \ Lores width
  84.   DisplayWidth 32 +        CONSTANT Slice1RasterWidth  \ Raster=SWidth+32
  85.   DisplayHeight            CONSTANT Slice1Height       \ Slice height
  86.   DisplayHeight 32 +       CONSTANT Slice1RasterHeight \ Slice Raster=DHgt+32
  87.   0                        CONSTANT Slice1Mode         \ Lores
  88.   3                        CONSTANT Slice1Planes       \ Slice bitplanes
  89.  
  90.   \ The calculation below takes the number of bitplanes and calculates
  91.   \ how many colours this represents.
  92.   \
  93.   \ One bitplane gives two colours.
  94.   \
  95.   \ Each additional bitplane multiplies the number of colours by two.
  96.   \
  97.   \ Performing a single LSL operation on any number multipies by 2, so we
  98.   \ have a quick method of multiplying by two for our colour calculation.
  99.   \
  100.   \ In this case, we need "2 to the power 3", which is 2*2*2=8.
  101.   \
  102.   \ e.g.                              2*2*2
  103.   \                                   ^ ^ ^
  104.   \                                   Total number of planes = 3
  105.   \
  106.   \
  107.   \ So, we take the first value two
  108.   \
  109.   \ e.g.                              2*2*2
  110.   \                                   ^
  111.   \                                  Initial start value of 2
  112.   \
  113.   \ and we now need to multiply it by two "the_number_of_planes minus_one"
  114.   \ more times.
  115.   \
  116.   \ e.g.                              2*2*2
  117.   \                                     ^ ^
  118.   \                                     Total planes minus one
  119.   \
  120.   \
  121.   \ So, Number of colours = 2 operated on by LSL NumberOfPlanes-1 times.
  122.   \
  123.  
  124.   2 Slice1Planes 1- LSL    CONSTANT Slice1Colours      \ A-slice colours
  125.  
  126.   \ ***********************
  127.   \ Error handling routines
  128.   \ ***********************
  129.  
  130.   \ This error handler allows all errors to be routed via a comprehensive
  131.   \ sequential closedown routine, which is associated with the HeliOS
  132.   \ system error handler word ERROR".
  133.   \
  134.   \ When ERROR" senses an error, it prints an associated error message
  135.   \ delimited by '"' characters, and then closes everything down using the
  136.   \ routine CLOSEDOWN below which you have supplied.
  137.   \
  138.   \ This simplifies errors checks to the use of a single word, ERROR", which
  139.   \ displays a text message and closes eveything down.
  140.   \
  141.  
  142.   0 VARIABLE (CLOSEDOWN)
  143.  
  144.   : ?CLOSEDOWNERROR
  145.  
  146.   IF
  147.     CR
  148.     CR
  149.     TYPE
  150.     CR
  151.     CR
  152.     ." Press <Space> to quit!"
  153.     CR
  154.     CR
  155.     WAITSPACE
  156.     (CLOSEDOWN) @EXECUTE
  157.     QUIT
  158.   ELSE
  159.     DDROP
  160.   THEN
  161.   ;
  162.  
  163.   LATESTCFA VARIABLE ERROR1
  164.  
  165.   \ ****************************************
  166.   \ Create display pointer storage variables
  167.   \ ****************************************
  168.  
  169.   \ Here we create a set of "pointers", initially set to a "null" value.
  170.   \
  171.   \ These "pointers" are set up as "long addresses" when various components
  172.   \ of the display system are allocated and initialised.
  173.   \
  174.   \ Note that initially these are all set to zero, and we clear them back
  175.   \ to zero when we de-allocate the associated resource.
  176.   \
  177.   \ These DPOINTERs are all initially set to "null" by using '0.'.
  178.   \
  179.   \ When we allocate memory or Amiga system resources in the program at
  180.   \ run-time, these pointers are updated to contain the 32-bit address
  181.   \ of the newly allocated resource.
  182.   \
  183.   \ Subsequently the symbolic DPOINTER name can be used in your code to
  184.   \ represent the associated address.
  185.  
  186.   0. DPOINTER Display1             \ Main Display structure pointer
  187.   0. DPOINTER Slice1               \ Slice 1 Slice structure pointer
  188.  
  189.   0. DPOINTER Slice1_ColorMap      \ Slice 1 ColourMap structure pointer
  190.  
  191.   0. DPOINTER Slice1_RasInfo       \ Slice 1 RasInfo structure pointer
  192.  
  193.   0. DPOINTER Slice1_BMap          \ Slice 1 BitMap structure pointer
  194.  
  195.   0. DPOINTER Slice1_RPort         \ Slice 1 RastPort structure pointer
  196.  
  197.   0. DPOINTER Slice1_SliceControl  \ Slice 1 SliceControl structure pointer
  198.  
  199.   \ *************
  200.   \ Colour tables
  201.   \ *************
  202.  
  203.   \ Each colour entry requies 2 bytes of storage space
  204.  
  205.   CREATEL Slice1_ColorTable        \ Create longword pointer to table
  206.   Slice1Colours 2* 0 ALLOTFILL     \ Allocate Slice1 colours * 2 bytes
  207.  
  208.   \ ***********************************
  209.   \ Create Display and Slice structures
  210.   \ ***********************************
  211.  
  212.   \ This routine simply makes blank structures, which then need to be
  213.   \ initialised later (in the CREATE_DISPLAY routine).
  214.  
  215.   : CREATE_DSLICES
  216.  
  217.   DS_SIZEOF MAKESTRUCTURE Display1 MAKEPOINTER  \ Main "Display" structure
  218.  
  219.   SL_SIZEOF MAKESTRUCTURE Slice1   MAKEPOINTER  \ Display "Slice" structure
  220.   ;
  221.  
  222.   : FREE_DSLICES
  223.  
  224.   Slice1    DDUP FREEMEMORY   CLEARPOINTER
  225.   Display1  DDUP FREEMEMORY   CLEARPOINTER
  226.   ;
  227.  
  228.   \ ******************************
  229.   \ Create RasInfo structures etc.
  230.   \ ******************************
  231.  
  232.   : CREATE_RASINFO
  233.  
  234.   \ First allocate and initialise complete RasInfo structures.
  235.   \
  236.   \ This routine automatically allocates all BitMaps etc.
  237.   \
  238.  
  239.   Slice1RasterWidth Slice1RasterHeight Slice1Planes  OPENRASINFO
  240.   DFLAG0= ERROR" Fail: RasInfo1"
  241.   Slice1_RasInfo MAKEPOINTER
  242.  
  243.   \ Set invisible area "sprite margins" for slice RasInfo
  244.  
  245.   16              Slice1_RasInfo         ri_RxOffset    INDEX!L
  246.   16              Slice1_RasInfo         ri_RyOffset    INDEX!L
  247.  
  248.   \ Store BitMap pointer - often useful for later reference
  249.  
  250.   Slice1_RasInfo  ri_BitMap INDEXD@L Slice1_BMap MAKEPOINTER
  251.   Slice1_BMap 0 MakeRPort
  252.   DFLAG0= ERROR" Fail: RastPort"
  253.   Slice1_RPort MAKEPOINTER
  254.   ;
  255.  
  256.   : FREE_RASINFO
  257.  
  258.   Slice1_RPort CLOSERPORT
  259.   Slice1_RasInfo   DDUP CLOSERASINFO   CLEARPOINTER
  260.   ;
  261.  
  262.   \ ********************************
  263.   \ Create Display/Slice Copperlists
  264.   \ ********************************
  265.  
  266.   \ This function builds the main display copperlist by:
  267.   \
  268.   \ 1. Initialising the Slice data structure
  269.   \ 2. Calling MAKECOPSTRIP for the slice, to build a copperlist
  270.   \ 3. Calling MAKEDISPLAY to build the master Display copperlist
  271.   \
  272.  
  273.   : CREATE_DISPLAY
  274.  
  275.   \ First initialise main display structures
  276.  
  277.   Slice1                           Display1  DS_Slice     INDEXD!L
  278.  
  279.   Slice1Width                      Slice1    SL_DWidth    INDEX!L
  280.   Slice1Height                     Slice1    SL_DHeight   INDEX!L
  281.   DisplayTopLine                   Slice1    SL_DyOffset  INDEX!L
  282.   Slice1_RasInfo                   Slice1    SL_RasInfo   INDEXD!L
  283.   Slice1_ColorMap                  Slice1    SL_ColorMap  INDEXD!L
  284.   Slice1Mode                       Slice1    SL_Modes     INDEX!L
  285.  
  286.   \ Generate copper list information for each of the display slices
  287.  
  288.   Slice1 MAKECOPSTRIP
  289.   D0= ERROR" Fail: Slice1CopStrip"
  290.  
  291.   \ Make display
  292.  
  293.   Display1 MAKEDISPLAY
  294.   D0= ERROR" Fail: Display1"
  295.   ;
  296.  
  297.   : FREE_DISPLAY
  298.  
  299.   Display1                 FREEDISPLAY
  300.   Slice1                   FREECOPSTRIP
  301.   ;
  302.  
  303.   \ ********************************************************
  304.   \ Create SliceControl structures for double buffered slice
  305.   \ ********************************************************
  306.  
  307.   \ SliceControl structures are used to control any slices which perform
  308.   \ mapping or scrolling functions, or which require double or triple
  309.   \ playfield buffering.
  310.   \
  311.   \ In this case we have one slice which does not scroll, is not mapped,
  312.   \ but IS double buffered.
  313.   \
  314.  
  315.   : CREATE_SLICECONTROL
  316.  
  317.   \ Make SliceControl for single buffered bitmap display
  318.  
  319.   Slice1
  320.   Slice1Width Negate
  321.   Slice1Height Negate
  322.   MAKESLICECONTROL
  323.   DFLAG0= ERROR" Fail: SliceControl1"
  324.   Slice1_SliceControl MAKEPOINTER
  325.  
  326.   \ Install slice controls into HeliOS display control system
  327.  
  328.   Slice1_SliceControl  INSTALLSLICECONTROL
  329.   ;
  330.  
  331.   : FREE_SLICECONTROL
  332.  
  333.   CLEARSLICECONTROLS
  334.   Slice1_SliceControl  CLOSESLICECONTROL
  335.   ;
  336.  
  337.   \ These routines load an IFF picture into supplied BitMap, and correctly
  338.   \ initialises the supplied ColorTable.
  339.   \
  340.   \ The ColorTable is then used to create an initialised ColorMap structure.
  341.   \
  342.  
  343.   : CREATE_IMAGERY
  344.  
  345.   Slice1_BMap
  346.   Slice1_ColorTable
  347.   Slice1Pic
  348.   10 2 DOSLIB                        \ Call to internal HeliOS library
  349.   10 <> ERROR" Fail: Slice1Pic"
  350.  
  351.   Slice1_ColorTable  Slice1Colours MAKECOLORMAP  \ Allocate ColourMap
  352.   DFLAG0= ERROR" Fail: Slice1ColorMap"
  353.   Slice1_ColorMap MAKEPOINTER
  354.   ;
  355.  
  356.   : FREE_IMAGERY
  357.  
  358.   Slice1_ColorMap  DDUP FREECOLORMAP  CLEARPOINTER
  359.   ;
  360.  
  361.  \ ---------------------------------------------------------------------------
  362.  \ Fonts Demo Code
  363.  \ ---------------------------------------------------------------------------
  364.  
  365.    0. DVARIABLE DiskFontBase
  366.  
  367.    0. DVARIABLE Topaz8Font
  368.    0. DVARIABLE Ruby8Font
  369.    0. DVARIABLE Ruby12Font
  370.    0. DVARIABLE Ruby15Font
  371.  
  372.    0. DPOINTER  TextureMap_BMap                 \ Texture BitMap pointer
  373.    0. DPOINTER  ColourFont_BMap                 \ Font BitMap pointer
  374.    0. DPOINTER  ColourFont_Mask_BMap            \ Mask BitMap pointer
  375.  
  376.    $CONSTANT DiskFont$ $diskfont.library$       \ Diskfont library name
  377.  
  378.    CREATEL FontName  <$ ruby.font$              \ New font name
  379.  
  380.    CREATEL TopazName <$ topaz.font$             \ Topaz font name
  381.  
  382.    CREATEL Topaz8                               \ Create Textattr Structure
  383.    TopazName D,
  384.    8  ,
  385.    0  C,                                        \ Normal
  386.    0  C,                                        \ In ROM
  387.  
  388.    CREATEL Ruby8                                \ Create Textattr Structure
  389.    FontName D,
  390.    9  ,
  391.    0  C,                                        \ Normal
  392.    2  C,                                        \ From Disk
  393.  
  394.    CREATEL Ruby12                               \ Create Textattr Structure
  395.    FontName D,
  396.    11  ,
  397.    2  C,                                        \ Bold
  398.    2  C,                                        \ From Disk
  399.  
  400.    CREATEL Ruby15                               \ Create Textattr Structure
  401.    FontName D,
  402.    15  ,
  403.    2  C,                                        \ Bold
  404.    2  C,                                        \ From Disk
  405.  
  406.    : SetFont                                    \ a1 - - -
  407.  
  408.    D@ 0 AREG D!                                 \ Set New Font Into Window
  409.    1 AREG D!
  410.    GFXBASE -66 LIBRARY
  411.    ;
  412.  
  413.    \ ***************************************************************
  414.    \ This font definition will be used for texture mapped colourfont
  415.    \ ***************************************************************
  416.  
  417.    CREATEL TextureFontDef
  418.  
  419.    0.  D,
  420.    0.  D,
  421.    16   ,
  422.    16   ,
  423.    100  ,
  424.    1    ,
  425.  
  426.    \ *********************************************************
  427.    \ This font definition will be used for standard colourfont
  428.    \ *********************************************************
  429.  
  430.    CREATEL ColourFontDef
  431.  
  432.    0.  D,
  433.    0.  D,
  434.    16   ,
  435.    16   ,
  436.    100  ,
  437.    1    ,
  438.  
  439.    : OPEN_FONTS
  440.  
  441.    \ Load font texture map imagery and prepare textured font definition
  442.  
  443.    TextureMapPic
  444.    2
  445.    3 DOSLIB
  446.    2 <>
  447.    IF
  448.     1 ERROR" Fail: TextureMapPic"
  449.    THEN
  450.    DDUP
  451.    TextureMap_BMap MAKEPOINTER
  452.    TextureFontDef D!L
  453.  
  454.    \ Load colour font imagery and prepare standard font definition
  455.  
  456.    ColourFontPic
  457.    2
  458.    3 DOSLIB
  459.    2 <>
  460.    IF
  461.     1 ERROR" Fail: ColourFontPic"
  462.    THEN
  463.    DDUP
  464.    ColourFont_BMap MAKEPOINTER
  465.    ColourFontDef D!L
  466.  
  467.    \ Generate font mask from font imagery bitmap
  468.  
  469.    ColourFont_BMap
  470.    GETMASK
  471.    DFLAG0= ERROR" Fail: ColourFontMask"
  472.    DTRIP
  473.    ColourFont_Mask_BMap MAKEPOINTER
  474.  
  475.    \ Install font mask in both font definitions
  476.  
  477.    TextureFontDef 4. D+ D!L
  478.    ColourFontDef 4. D+ D!L
  479.  
  480.    \ Set up standard Amiga fonts
  481.  
  482.    DiskFont$ 0 OPENLIB
  483.    DFLAG0= ERROR" Fail: DiskFont Library"
  484.    DiskFontBase D!
  485.  
  486.    Topaz8 0 AREG D!
  487.    DiskFontBase  -30 LIBRARY
  488.    D0RESULT
  489.    DFLAG0= ERROR" Fail: Topaz8 Font"
  490.    Topaz8Font D!
  491.  
  492.    Ruby8 0 AREG D!
  493.    DiskFontBase  -30 LIBRARY
  494.    D0RESULT
  495.    DFLAG0= ERROR" Fail: Ruby8 Font"
  496.    Ruby8Font D!
  497.  
  498.    Ruby12 0 AREG D!
  499.    DiskFontBase  -30 LIBRARY
  500.    D0RESULT
  501.    DFLAG0= ERROR" Fail: Ruby12 Font"
  502.    Ruby12Font D!
  503.  
  504.    Ruby15 0 AREG D!
  505.    DiskFontBase  -30 LIBRARY
  506.    D0RESULT
  507.    DFLAG0= ERROR" Fail: Ruby15 Font"
  508.    Ruby15Font D!
  509.    ;
  510.  
  511.    : CLOSE_FONTS
  512.  
  513.    Ruby8Font D@
  514.    1 AREG D!
  515.    GFXBASE -78 LIBRARY
  516.  
  517.    Ruby12Font D@
  518.    1 AREG D!
  519.    GFXBASE -78 LIBRARY
  520.  
  521.    Ruby15Font D@
  522.    1 AREG D!
  523.    GFXBASE -78 LIBRARY
  524.  
  525.    Topaz8Font D@
  526.    1 AREG D!
  527.    GFXBASE -78 LIBRARY
  528.  
  529.    DiskFontBase D@ CLOSELIB
  530.  
  531.    0. SETHELIOSFONT
  532.  
  533.    ColourFont_Mask_BMap DDUP CLOSEBMAP CLEARPOINTER
  534.  
  535.    ColourFont_BMap      DDUP CLOSEBMAP CLEARPOINTER
  536.  
  537.    TextureMap_BMap      DDUP CLOSEBMAP CLEARPOINTER
  538.    ;
  539.  
  540.   \ *********************
  541.   \ Close down everything
  542.   \ *********************
  543.  
  544.   : CLOSEDOWN
  545.  
  546.   FREE_SLICECONTROL
  547.   FREE_DISPLAY
  548.   FREE_IMAGERY
  549.   FREE_RASINFO
  550.   FREE_DSLICES
  551.   CLOSE_FONTS
  552.   RESETERROR"
  553.   ;
  554.  
  555.   LATESTCFA (CLOSEDOWN) !
  556.  
  557.   : TestDisplay          \ Start of program
  558.  
  559.   SCRCLR
  560.  
  561.   CR
  562.   ."        **********************************************************"
  563.   CR 6 FPENSET
  564.   ."                              FONTS DEMO"
  565.   CR 1 FPENSET
  566.   ."        **********************************************************"
  567.   CR
  568.   CR
  569.   ."        This code demonstrates how to display text in various fonts"
  570.   CR
  571.   ."        using both standard Amiga fonts and HeliOS colour bitmap fonts."
  572.   CR
  573.   CR
  574.   ."        The demo shows how both these types of font may be used in"
  575.   CR
  576.   .$        HeliOS "Game Mode" or under the Amiga operating system.$
  577.   CR
  578.   CR
  579.   ."        First the production of text using both types of fonts is"
  580.   CR
  581.   ."        demonstrated under the Amiga operating system."
  582.   CR
  583.   CR
  584.   ."        An IFF file is then loaded and displayed under the HeliOS"
  585.   CR
  586.   ."        Game operating system, after which text using the various"
  587.   CR
  588.   ."        fonts is displayed once more."
  589.   CR
  590.   CR
  591.   ."        **********************************************************"
  592.   CR 6 FPENSET
  593.   ."                  Press <Space> or <L-Mouse> to see Demo          "
  594.   CR 1 FPENSET
  595.   ."        **********************************************************"
  596.   CR
  597.  
  598.   WAITSPACE
  599.  
  600.   SCRCLR
  601.  
  602.   ERROR1 SETERROR"       \ Redirect system errors to our routine ERROR1
  603.  
  604.   OPEN_FONTS
  605.   CREATE_DSLICES
  606.   CREATE_RASINFO
  607.   CREATE_IMAGERY
  608.   CREATE_DISPLAY
  609.   CREATE_SLICECONTROL
  610.  
  611.   100 100 GFXMOVE
  612.   FRPORT Ruby8Font SetFont
  613.   LIT$ This is text in Ruby 8 font$
  614.   COUNT GFXTEXT
  615.  
  616.   100 120 GFXMOVE
  617.   FRPORT Ruby12Font SetFont
  618.   LIT$ This is text in Ruby 12 Bold font$
  619.   COUNT GFXTEXT
  620.  
  621.   100 140 GFXMOVE
  622.   FRPORT Ruby15Font SetFont
  623.   LIT$ This is text in Ruby 15 Bold font$
  624.   COUNT GFXTEXT
  625.  
  626.   100 160 GFXMOVE
  627.   FRPORT Topaz8Font SetFont
  628.   LIT$ This is text in Topaz8 font$
  629.   COUNT GFXTEXT
  630.  
  631.   \ *******************************************
  632.   \ Render text using texture mapped colourfont
  633.   \ *******************************************
  634.  
  635.   TextureFontDef SETHELIOSFONT
  636.  
  637.   100 180 GFXMOVE
  638.   FRPORT
  639.   LIT$L Textured ColourFont$ COUNTL DROP
  640.   HELIOSRPTEXT
  641.  
  642.   \ *************************************
  643.   \ Render text using standard colourfont
  644.   \ *************************************
  645.  
  646.   ColourFontDef SETHELIOSFONT
  647.  
  648.   FBMAP
  649.   LIT$L Standard ColourFont$ COUNTL DROP
  650.   100 200 0 0
  651.   HELIOSBMTEXT
  652.  
  653.   WAITSPACE
  654.  
  655.   SCRCLR
  656.  
  657.   0. Slice1_RPort MAKEGFXRPORT
  658.  
  659.   HeliOS_On
  660.  
  661.   1 FrameRate !L
  662.  
  663.   Display1 SHOWDISPLAY
  664.  
  665.   1 GFXSETAPEN
  666.  
  667.   35 100 GFXMOVE
  668.   Slice1_RPort Ruby8Font SetFont
  669.   LIT$ This is Ruby 8$
  670.   COUNT GFXTEXT
  671.  
  672.   35 120 GFXMOVE
  673.   Slice1_RPort Ruby12Font SetFont
  674.   LIT$ This is Ruby 12 Bold$
  675.   COUNT GFXTEXT
  676.  
  677.   35 140 GFXMOVE
  678.   Slice1_RPort Ruby15Font SetFont
  679.   LIT$ This is Ruby 15 Bold$
  680.   COUNT GFXTEXT
  681.  
  682.   35 160 GFXMOVE
  683.   Slice1_RPort Topaz8Font SetFont
  684.   LIT$ This is Topaz8$
  685.   COUNT GFXTEXT
  686.  
  687.   \ *******************************************
  688.   \ Render text using texture mapped colourfont
  689.   \ *******************************************
  690.  
  691.   TextureFontDef SETHELIOSFONT
  692.  
  693.   25 180 GFXMOVE
  694.   Slice1_RPort
  695.   LIT$L Textured ColourFont$ COUNTL DROP
  696.   HELIOSRPTEXT
  697.  
  698.   \ *************************************
  699.   \ Render text using standard colourfont
  700.   \ *************************************
  701.  
  702.   ColourFontDef SETHELIOSFONT
  703.  
  704.   Slice1_RPort rp_BitMap INDEXD@L
  705.   LIT$L Standard ColourFont$ COUNTL DROP
  706.   25 200 0 0
  707.   HELIOSBMTEXT
  708.  
  709.   WAITSPACE
  710.  
  711.   HeliOS_Off
  712.  
  713.   FSCREEN FRPORT MAKEGFXRPORT
  714.  
  715.   CLOSEDOWN
  716.   ;
  717.  
  718.   TestDisplay
  719.  
  720.  \ *****************************************************************
  721.  \ End
  722.  \ *****************************************************************
  723.